package blueBridge;

import java.util.Scanner;
/*

1
5
1 3 5 7 2
1 3, 5 7 2
5 7, 1 3 2
1 3 2, 5 7
5 7 2, 1 3
2, 1 3 5 7
1 3 5 7, 2
null, 1 3 5 7 2
1 3 5 7 2, null
1 7, 5 3 2
3 7, 1 5 2
1 5 2, 3 7
1 7 2, 5 3

1 2 3
null, 1 2 3
1, 2 3
2, 1 3
3, 1 2



 */
public class ArraysDivision {
    
    static Scanner scan = new Scanner(System.in);
    int[] arr;

    public ArraysDivision(int[] arr) {
        this.arr = arr;
    }
    
    public int getCount() {
        int count = 0, evenCount = 0, oddCount = 0;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] % 2 == 0) {
                evenCount++;
            }
        }
        oddCount = arr.length - evenCount;
        if (oddCount % 2 != 0) {
            return 0;
        }
        int divideCount = evenCount + oddCount/2;
        int end = 0;
        boolean even = divideCount % 2 == 0;
        if (even) {
            end = divideCount / 2 - 1;
        } else {
            end = divideCount / 2;
        }
        for (int i = 0; i <= end; i++) {
            count += combine(divideCount, i);
        }
        count *= 2;
        if (even) {
            count += combine(divideCount, divideCount/2);
        }
        // System.out.println(count);
        return count;
    }
    
    public int combine(int n, int m) {
        System.out.println(n + ", " + m);
        int permutation = 1;
        int mFactorial = 1;
        for (int i = n; i > n-m; i--) {
            permutation *= i;
        }
        for (int i = 1; i <= m; i++) {
            mFactorial *= i;
        }
        return permutation / mFactorial;
    }


    public static void main(String[] args) {
        int t = scan.nextInt();
        while (t-- > 0) {
            int n = scan.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = scan.nextInt();
            }
            ArraysDivision a = new ArraysDivision(arr);
            System.out.println(a.getCount());
        }

    }

}